import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../components/Home.vue'
const Home = () => import(/* webpackChunkName:"Home" */ '../components/Home.vue')

// import CommonHead from '../components/CommonHead.vue'
const CommonHead = () => import(/* webpackChunkName:"PhotoShare_PhotoInfo" */ '../components/CommonHead.vue')

// import PhotoShare from '../components/PhotoShare'
const PhotoShare = () => import(/* webpackChunkName:"PhotoShare_PhotoInfo" */ '../components/PhotoShare')

// import PhotoInfo from '../components/Photo_info'
const PhotoInfo = () => import(/* webpackChunkName:"PhotoShare_PhotoInfo" */ '../components/Photo_info')

// import Goods from '../components/Goods.vue'
const Goods = () => import(/* webpackChunkName:"Goods_goodsDetail" */ '../components/Goods.vue')

// import goodsDetail from '../components/goodsDetail.vue'
const goodsDetail = () => import(/* webpackChunkName:"Goods_goodsDetail" */ '../components/goodsDetail.vue')

// import imageText from '../components/ImageText.vue'
const imageText = () => import(/* webpackChunkName:"imageText" */ '../components/ImageText.vue')

// import NewsList from '../components/news/NewList.vue'
const NewsList = () => import(/* webpackChunkName:"NewsList_NewsDetail" */ '../components/news/NewList.vue')

// import NewsDetail from '../components/news/newsDetail.vue'
const NewsDetail = () => import(/* webpackChunkName:"NewsList_NewsDetail" */ '../components/news/newsDetail.vue')

// import review from '../components/review.vue'
const review = () => import(/* webpackChunkName:"review" */ '../components/review.vue')

// import map from '../components/Map.vue'
const map = () => import(/* webpackChunkName:"map_MapDetail" */ '../components/Map.vue')

// import MapDetail from '../components/MapDetail.vue'
const MapDetail = () => import(/* webpackChunkName:"map_MapDetail" */ '../components/MapDetail.vue')

// import Video from '../components/Video'
const Video = () => import(/* webpackChunkName:"Video" */ '../components/Video')

// import Leavewords from '../components/Leavewords'
const Leavewords = () => import(/* webpackChunkName:"Leavewords" */ '../components/Leavewords')

// import Search from '../components/Search.vue'
const Search = () => import(/* webpackChunkName:"Search" */ '../components/Search.vue')

// import Adding from '../components/Adding.vue'
const Adding = () => import(/* webpackChunkName:"Adding" */ '../components/Adding.vue')

// import MobileLogin from '../components/MobileLogin.vue'
const MobileLogin = () => import(/* webpackChunkName:"MobileLogin" */ '../components/MobileLogin.vue')

// import VerificationLogin from '../components/VerificationLogin.vue'
const VerificationLogin = () => import(/* webpackChunkName:"VerificationLogin" */ '../components/VerificationLogin.vue')

// 新增加
// import Shopping from '../components/shopcart/Shopping.vue'
const Shopping = () => import(/* webpackChunkName:"Shopping" */ '../components/shopcart/Shopping.vue')

// import Price from '../components/shopcart/Price.vue'
const Price = () => import(/* webpackChunkName:"Price" */ '../components/shopcart/Price.vue')

// import Good from '../components/category/Good.vue'
const Good = () => import(/* webpackChunkName:"Good" */ '../components/category/Good.vue')

// import Serch from '../components/category/Serch.vue'
const Serch = () => import(/* webpackChunkName:"Serch" */ '../components/category/Serch.vue')

// import goodsComment from '../components/goodscomment.vue'
const goodsComment = () => import(/* webpackChunkName:"goodsComment" */ '../components/goodscomment.vue')

// import Member from '../components/member/Member.vue'
const Member = () => import(/* webpackChunkName:"Member" */ '../components/member/Member.vue')

// import Order from '../components/member/Order.vue'
const Order = () => import(/* webpackChunkName:"Order" */ '../components/member/Order.vue')

Vue.use(VueRouter)

const routes = [
  { path: '/video', component: Video },
  { path: '/leavewords', component: Leavewords },
  { path: '/photoInfo/:id', component: PhotoInfo, props: true },
  { path: '/', name: 'Home', component: Home },
  { path: '/commonHead', component: CommonHead },
  { path: '/shop', component: Shopping },
  { path: '/price', component: Price },
  { path: '/good', component: Good },
  { path: '/serch', component: Serch },
  { path: '/photoShare', component: PhotoShare },
  { path: '/adding', component: Adding },
  {
    path: '/goods',
    component: Goods
  }, {
    path: '/newslist',
    component: NewsList,
    meta: {
      keepAlive: true// 需要被缓存
    }
  },
  {
    path: '/goods',
    component: Goods
  },
  {
    path: '/goodsDetail/:id',
    component: goodsDetail,
    props: true
  },
  {
    path: '/map',
    component: map
  },
  {
    path: '/mapDetail',
    component: MapDetail,
    name: 'MapDetail',
    props: true
  },
  {
    path: '/mobilelogin', component: MobileLogin
  },
  {
    path: '/verificationlogin', component: VerificationLogin
  },
  {
    path: '/search', component: Search
  },
  {
    path: '/review/:id',
    component: review,
    props: true
  },
  {
    path: '/imageText/:id',
    component: imageText,
    props: true
  },
  {
    path: '/goodscomment',
    component: goodsComment,
    props: true
  },
  {
    path: '/newslist/detail',
    component: NewsDetail,
    meta: {
      keepAlive: false // 不需要被缓存
    }
  },
  { path: '/member', component: Member },
  {
    path: '/order/:id',
    component: Order,
    props: true
  }

]

const router = new VueRouter({
  routes
})

export default router
